import App from '../App.vue'
import Login from '../login/loginModule.vue'
import Register from '../register/registerModel.vue'
import Home from '../page/home/home.vue'
import CommonModule from '../components/common/commonModule.vue'
import LoginModule from '../login/loginModule.vue'
import RegisterModel from '../register/registerModel.vue'
import User from '../page/user/user.vue'
import RegisterConsumer from '../page/register/registerConsumer.vue'
import RegisterShop from '../page/register/registerShop.vue'
//404
import NotFoundComponent from '../notFoundComponent.vue'

//普通会员
import Basic from '../page/register/basic.vue'
import Work from '../page/register/work.vue'
import Poperty from '../page/register/property.vue'
import Bank from '../page/register/bank.vue'
import Uploading from '../page/register/uploading.vue'

//商店注册
import ShopBank from '../page/register/shopBank.vue'
import ShopBasic from '../page/register/shopBasic.vue'
import ShopUploading from '../page/register/shopUploading.vue'

//会员页
import UserCommon from '../components/common/userCommon.vue'
import AdminCommon from '../page/commons/adminCommon/adminCommon.vue'
import ConsultingCommon from '../page/commons/consultingCommon/consultingCommon.vue'
import ShopCommon from '../page/commons/shopCommon/shopCommon.vue'

//基本单元格
import BasicTable from '../page/listCommon/tables/basicTable.vue'
import UserDream from '../page/listCommon/views/userDream.vue'
//         basic,
//         work,
//         poperty,
//         bank,
//         uploading
// import Basic from '../page/register/basic.vue'
// import Work from '../page/register/work.vue'
// import Poperty from '../page/register/property.vue'
// import Bank from '../page/register/bank.vue'
// import Uploading from '../page/register/uploading.vue'
// import ShopBasic from '../page/register/shopBasic.vue'
// import ShopBank from '../page/register/shopBank.vue'
// import ShopUploading from '../page/register/shopUploading.vue'
// import AdminCommon from ''
// const Home = r => require.ensure([], () => r(require('../home/home.vue')), 'home')
export default [{

        path: '/',
        component: App,
        children: [{
                path: '',
                redirect: '/home'
            },{
                path: "user",
                component: User,
                children:[{
                  path:'',
                  redirect:'userCommon'
                },{
                  path:'userCommon',
                  component:UserCommon,
                  children:[{
                    path:'',
                    redirect:'dream'
                  },{
                    path:'dream',     //我的淘梦
                    component:UserDream
                  },{
                    path:'expenseRecord', //消费记录
                    component:BasicTable
                  },{
                    path:'withdrawalsRecord',//提现记录
                    component:BasicTable
                  },{
                    path:'conversionRecord',//兑换记录
                    component:BasicTable
                  },{
                    path:'TDRecord',//TD流水
                    component:BasicTable
                  },{
                    path:'limitRecord',//额度流水
                    component:BasicTable
                  },{
                    path:'recommendRecord',//推荐记录
                    component:BasicTable
                  },{
                    path:'recommendStimulate',//推荐激励
                    component:BasicTable
                  }]
                },{
                  path:'adminCommon', //管理员内容
                  component:AdminCommon,
                  children:[{
                    path:'',
                    redirect:'consumerManage'
                  },{
                    path:'consumerManage', //消费者管理
                    component:BasicTable
                  },{
                    path:'shopManage',  //商家管理
                    component:BasicTable
                  },{
                    path:'salesmanManage',//业务员管理
                    component:BasicTable
                  },{
                    path:'recommendRecord', //消费记录
                    component:BasicTable
                  },{
                    path:'withdrawalsAudit', //提现审查
                    component:BasicTable
                  },{
                    path:'consumerWithdrawalsLimitAudit',//消费者提额审查
                    component:BasicTable
                  },{
                    path:'shopWithdrawalsLimitAudit', //商家提额审查
                    component:BasicTable
                  },{
                    path:'userAuthorityManagement', //用户权限管理
                    component:BasicTable
                  }]
                },{
                  path:'consultingCommon', //咨询师内容
                  component:ConsultingCommon,
                  children:[{
                    path:'',
                    redirect:'dream'
                  },{
                    path:'dream', //我的淘梦
                    component:BasicTable
                  },{
                    path:'salesmanRecord', //业务记录
                    component:BasicTable
                  },{
                    path:'relevanceExpenseRecord', //关联消费记录
                    component:BasicTable
                  }]
                },{
                  path:'shopCommon',
                  component:ShopCommon,
                  children:[{
                    path:'',
                    redirect:'dream'
                  },{
                    path:'dream',
                    component:BasicTable //我的淘梦
                  },{
                    path:'expenseRecord', //消费记录
                    component:BasicTable
                  },{
                    path:'withdrawalsRecord', //提现记录
                    component:BasicTable
                  },{
                    path:'conversionRecord', //兑换记录
                    component:BasicTable
                  },{
                    path:'TDRecord', //淘豆流水
                    component:BasicTable
                  },{
                    path:'limitRecord', //额度流水
                    component:BasicTable
                  }]
                }]
            }, {
                path: '/home',
                components: {
                    default: Home
                },
                children: [{
                    path: '/',
                    component: CommonModule,
                    children: [{
                            path: '',
                            redirect: 'login'
                        },
                        {
                            path: 'login',
                            component: LoginModule,

                        }, {
                            path: 'register',
                            component: RegisterModel
                        }
                    ]
                }, {
                    path: "registerConsumer",
                    component: RegisterConsumer,
                    children: [{
                        path: '',
                        redirect: 'basic'
                    }, {
                        path: 'basic',
                        component: Basic
                    }, {
                        path: 'work',
                        component: Work
                    }, {
                        path: 'poperty',
                        component: Poperty
                    }, {
                        path: 'bank',
                        component: Bank
                    }, {
                        path: 'uploading',
                        component: Uploading
                    }]
                },{
                  path:'registerShop',
                  component:RegisterShop,
                  children:[{
                    path: '',
                    component: ShopBasic
                  },
                  {
                    path: 'shopBasic',
                  component: ShopBasic
                  },
                  {
                    path:'shopBank',
                    component:ShopBank
                  },{
                    path:'shopUploading',
                    component:ShopUploading
                  }]
                }]
            },
            // {
            //     path: '/user',
            //     components: {
            //         default: User
            //     }
            // }, {
            //     path: '/registerConsumer',
            //     component: RegisterConsumer,
            // children: [{
            //     path: '/basic',
            //     component: Basic
            // }, {
            //     path: '/work',
            //     component: Work
            // }, {
            //     path: '/poperty',
            //     component: Poperty
            // }, {
            //     path: '/bank',
            //     component: Bank
            // }, {
            //     path: '/uploading',
            //     component: Uploading
            // }]
            // },
            // {
                // path: '/registerShop',
                // component: RegisterShop,
                // children:[{
                //   path: '/shopBasic',
                //   component:ShopBasic
                // },{
                //   path: '/shopBank',
                //   component:ShopBank
                // },{
                //   path: '/shopUploading',
                //   component:ShopUploading
                // }]
            // }
        ]

    },{
       path: '*', component: NotFoundComponent
    }

]
// {
//
//   loginview: Login,
//   registerview: Register,
//
// }
// export default [{
//     path: '/',
//     component: APP, //顶级路由
//     children: [ //二级路由
//         {
//             path: '/:uid',
//             redirect: '/二级路由默认页/:id'
//         },
//         {
//             path: '/user/:uid普通用户页面',
//             component: 'ObjModel',
//             children: [{
//                 path: 'taodo',
//                 component: 'ObjModel',
//                 children: [{
//                     path: '淘豆流水',
//                     component: 'ObjModel'
//                 }, {
//                     path: '兑换记录',
//                     component: 'ObjModel'
//                 }, {
//                     path: '提现记录',
//                     component: 'ObjModel'
//                 }]
//             }, {
//                 path: 'xiaofei',
//                 component: 'ObjModel',
//                 children: [{
//                     path: '消费记录',
//                     component: 'ObjModel'
//                 }]
//             }, {
//                 path: 'xianggaun',
//                 component: 'ObjModel',
//                 children: [{
//                     path: '与我相关',
//                     component: 'ObjModel'
//                 }, {
//                     path: '我的激励',
//                     component: 'ObjModel'
//                 }]
//             }, {
//                 path: '淘豆剩余',
//                 component: 'ObjModel'
//             }, {
//                 path: '活跃度',
//                 component: 'ObjModel'
//             }, {
//                 path: '提现额度',
//                 component: 'ObjModel'
//             }]
//         },
//         {
//             path: '/admin/:id管理者页面',
//             component: 'ObjModel',
//             children: [{
//                 path: '待审查',
//                 component: 'ObjModel',
//                 children: [{
//                     path: '客户审查',
//                     component: 'ObjModel'
//                 }, {
//                     path: '提现确认',
//                     component: 'ObjModel'
//                 }]
//             }, {
//                 path: '待确认',
//                 component: 'ObjModel',
//                 children: [{
//
//                 }]
//             }]
//         },
//         {
//             path: '/shop/:商户页面',
//             component: 'ObjModel',
//             children: [{
//                 path: '订单量',
//                 component:'ObjModel',
//                 children:[{
//                   path:'出单量',
//                   component:'ObjModel'
//                 },{
//                   path:'返利设置',
//                   component:'ObjModel'
//                 }]
//             },{
//               path:'库存',
//               component:'ObjModel'
//             }]
//         }
//     ]
// }]
